<html>
<head><meta charset="utf-8"><title>Remove doctree::Macro · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html">Remove doctree::Macro</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218030397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030397">(Nov 26 2020 at 18:51)</a>:</h4>
<p>I know <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> has been working on removing doctree types. Would it be duplicated effort for me to look at removing doctree::Macro, or a welcome break up of effort? I say this because I was looking at issue <a href="https://github.com/rust-lang/rust/issues/76761">rust/76761</a>,  and figured it would be better to remove the Macro object before making any changes, instead of after.</p>



<a name="218030616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030616">(Nov 26 2020 at 18:55)</a>:</h4>
<p>that would be really great!</p>



<a name="218030625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030625">(Nov 26 2020 at 18:55)</a>:</h4>
<p>the relevant bit is <a href="https://github.com/rust-lang/rust/blob/65ecc481fac7ceced57d973a580d0a7ccbdcb192/src/librustdoc/visit_ast.rs#L343">https://github.com/rust-lang/rust/blob/65ecc481fac7ceced57d973a580d0a7ccbdcb192/src/librustdoc/visit_ast.rs#L343</a></p>



<a name="218030706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030706">(Nov 26 2020 at 18:56)</a>:</h4>
<p>the idea is to, instead of returning a new <code>Macro</code> there and storing it on the output module (<code>om</code>), store the <code>MacroDef</code> directly instead</p>



<a name="218030726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030726">(Nov 26 2020 at 18:57)</a>:</h4>
<p>however it shouldn't change the behavior, so anything tricky going on in <code>visit_ast</code> should be moved to <a href="https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/mod.rs">https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/mod.rs</a> instead</p>



<a name="218030742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030742">(Nov 26 2020 at 18:57)</a>:</h4>
<p>there should be an <code>impl Clean for doctree::Macro</code> somewhere</p>



<a name="218030819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030819">(Nov 26 2020 at 18:58)</a>:</h4>
<p>Yep, I already have the impl up on my screen, and I'm looking through your merged PRs for where else I'll need to look. Thank you for the help</p>



<a name="218030853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218030853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218030853">(Nov 26 2020 at 18:59)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/79372">https://github.com/rust-lang/rust/pull/79372</a> makes some changes to <code>from_def_id_and_kind</code>, but not super major, just enough that it will be annoying to rebase over</p>



<a name="218031633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218031633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218031633">(Nov 26 2020 at 19:11)</a>:</h4>
<p>Annoying thing: A macro ends up coming from a hir::MacroDef instead of a hir::Item (They are almost identical structs, with the difference being Item has a <code>kind: ItemKind&lt;'hir&gt;</code> and MacroDef has an <code>ast: ast::MacroDef</code>). I guess clean::Module keeps a seperate macro vector, instead of adding them to items, but they're added as a <code>(MacroDef, Option&lt;Ident&gt;)</code> now.</p>



<a name="218031726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218031726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218031726">(Nov 26 2020 at 19:12)</a>:</h4>
<p>sure, seems reasonable</p>



<a name="218033690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218033690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218033690">(Nov 26 2020 at 19:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro/near/218030853">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/rust/pull/79372">https://github.com/rust-lang/rust/pull/79372</a> makes some changes to <code>from_def_id_and_kind</code>, but not super major, just enough that it will be annoying to rebase over</p>
</blockquote>
<p>It looks like that was approved, so I may wait till that's merged and I can pull it in, then commit. That way all my changes are on top of it.</p>



<a name="218035316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218035316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218035316">(Nov 26 2020 at 20:13)</a>:</h4>
<p>you don't need to wait until it's merged, you can rebase on top of it</p>



<a name="218035329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218035329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218035329">(Nov 26 2020 at 20:13)</a>:</h4>
<p><code>git fetch origin pull/79372/head &amp;&amp; git rebase FETCH_HEAD</code></p>



<a name="218045774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Remove%20doctree%3A%3AMacro/near/218045774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Remove.20doctree.3A.3AMacro.html#218045774">(Nov 26 2020 at 23:47)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/rust/pull/79455">https://github.com/rust-lang/rust/pull/79455</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>